<?php
define('MINI_RUN', true);
require ('mini.php');
if ($_POST['username']&&$_POST['password']&&$_POST['imgcode'])
	Mini::login($_POST['username'], $_POST['password'],$_POST['imgcode']);
?>
<!DOCTYPE html>
<html>
<head>
<title>登录--<?=Mini::NAME?>后台管理系统</title>
<?=Mini::ADMIN_CSS?>
<style type="text/css">
table{border:1px solid #88c;}
</style>
</head>

<body>
<br /><br /><br /><br /><br /><br /><br />
<center>
<form id="LoginForm" action="login.php" method="post">
<table cellpadding="10">
<tr><td>账号*：</td><td align="left"><input name="username" id="username" type="text" value="<?php echo $_COOKIE['UserName']?$_COOKIE['UserName']:'';?>" /></td></tr>
<tr><td>密码*：</td><td align="left"><input name="password" id="password" type="password" /></td></tr>
<tr><td>验证码*：</td><td align="left"><input name="imgcode" id="imgcode" type="text" size="8" />&nbsp;<img id="img" src="image.php" title="点击更换图片" alt="验证码" /></td></tr>
<tr><td>&nbsp;</td><td align="left"><input type="submit" id="submit" value="登录" /></td></tr>
</table>
</form>
</center>
<?=Mini::JQUERY_JS?>
<?=Mini::ADMIN_JS?>
<script type="text/javascript">
$(function (){
	if($.trim($("#username").val()) == "") $("#username").focus();
	else $("#password").focus();
	
	$("#img").click(function(){
		$("#img").attr("src","image.php?img=" + new Date());		
	});
	$('#LoginForm').submit(function(){
		if(checkValue("#username","用户名")) return false;
		if(checkValue("#password","密码")) return false;
		if(checkValue("#imgcode","验证码")) return false;		
	});
});
</script>
</body>
</html>
